﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class cube : MonoBehaviour
{
    
    protected float speed = 9.0f;
    // Start is called before the first frame update
    protected virtual void Start()
    {
        
    }

    // Update is called once per frame
    private void FixedUpdate()
    {
        //this.GetComponent<Rigidbody>().velocity = Vector3.left * speed;
        this.transform.Translate(-speed * Time.deltaTime, 0, 0, Space.World);
        Unfind();
    }
    private void Unfind()
    {
        if (transform.position.x <= -12)
        {
            Destroy(this.gameObject);
        }
    }
}
